#ifndef __HT_LOGGER_H__
#define __HT_LOGGER_H__

#include <log4c.h>

#ifdef __cplusplus
extern "C" {
#endif

int  InitLogger();

__attribute__((format(printf, 2, 3)))
void WriteLog(int nPriority, const char* pszFormat, ...);
void DeinitLogger();

#define LOG__FATAL(pszFormat, args...)     WriteLog(LOG4C_PRIORITY_FATAL,  pszFormat, ##args)
#define LOG__ALERT(pszFormat, args...)     WriteLog(LOG4C_PRIORITY_ALERT,  pszFormat, ##args)
#define LOG__CRIT(pszFormat, args...)      WriteLog(LOG4C_PRIORITY_CRIT,   pszFormat, ##args)
#define LOG__ERROR(pszFormat, args...)     WriteLog(LOG4C_PRIORITY_ERROR,  pszFormat, ##args)
#define LOG__WARN(pszFormat, args...)      WriteLog(LOG4C_PRIORITY_WARN,   pszFormat, ##args)
#define LOG__NOTICE(pszFormat , args...)   WriteLog(LOG4C_PRIORITY_NOTICE, pszFormat, ##args)
#define LOG__INFO(pszFormat , args...)     WriteLog(LOG4C_PRIORITY_INFO,   pszFormat, ##args)
#define LOG__DEBUG(pszFormat , args...)    WriteLog(LOG4C_PRIORITY_DEBUG,  pszFormat, ##args)

#ifdef __cplusplus
}
#endif

#endif

